﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>发财审核-微街秀管理后台</title>
<style>
/*分页*/
.pager_style{width:100%;height:30px;margin-top:10px;text-align:left;color:#909090;}
.pager_style li{font-size:14px;}
.pager_style .page_num{height:100%;font-size:0;display:inline-block; float:left;}
.pager_style .page_num li{height:100%;border:1px solid #eeeeee;padding:0 10px;margin-right:5px;line-height:30px;display:inline-block;cursor:pointer;float:left;}
.pager_style .page_num li:hover{border:1px solid #f37b0b;background-color:#f37b0b;color:White;}

/*分页 选中当页样式*/
.pager_style .page_num .active{border:1px solid #f37b0b;background-color:#f37b0b;color:White;cursor:default;}
/*分页 不可用样式*/
.pager_style .page_num .disable{background-color:#f1f1f1;}
.pager_style .page_num .disable:hover{border:1px solid #eeeeee;background-color:#f1f1f1;color:#909090;}

.pager_style .page_info{display:inline-block;float:left;}
.pager_style .page_info li{display:inline-block;margin-left:10px;float:left;line-height: 30px;}

table{border-collapse: collapse;border: none;width: 980px; text-align:center;}
td{border: solid #ccc 1px;color:Black; height:26px;}
td a{ text-decoration:none;}
.td1,.td2,.td3,.td6{width:100px; font-weight:bold; text-align:center;}
.td4,.td5{width:250px; font-weight:bold; text-align:center;}
</style>
    <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="../js/base.js" type="text/javascript"></script>
    <script src="../js/ajax-data.js" type="text/javascript"></script>
    <script src="../js/Pager.js" type="text/javascript"></script>
    <script src="../js/dialog.js" type="text/javascript"></script>
</head>
<body>
<div style="width:980px; margin-left:auto; margin-right:auto;">

<div> 会员编号:<input type="text" id="userid" name="userid" style="width:80px;" />
    状态：<select id="state" name="state">
        <option value="-1">不限</option>
        <option value="0">未审核</option>
        <option value="1">已审核</option>
        <option value="2">已拒绝</option>
    </select>   
    <input type="button" id="btn" value="搜 索" onclick="submits()" /></div>
    <br />
  <table id="list">
    </table>
 <div class="pager_style">
    <ul class="page_num"></ul>
    <ul class="page_info">
        <li>总数:<span id="count">0</span></li>
        <li>每页:<span id="pageSize">0</span></li>
        <li>页数:<span id="pageToal">0</span></li>
    </ul>
</div>
<input type="hidden" id="pagecount" value="0" />
</div>
 <script>
     var pager = new Pager();
     $(function () {
         islogin();
         if (getUrlArgStr("state") != null)
             $("#state").val(getUrlArgStr("state"));
         GetList(1);
     })

     function GetList(page) {
         var userid = $("#userid").val();
         var state = $("#state").val();

         var param = "page_index=" + page;

         if (userid != "")
             param += "&user_id=" + userid;
         if (state != "")
             param += "&state=" + state;

         $("#list").html("");
         var html = "<tr><td class='td2'>会员ID</td><td class='td3'>名称</td><td class='td3'>微信人数</td><td class='td3'>微信资料</td><td class='td3'>手机号</td><td class='td5'>地区</td><td class='td3'>状态</td><td class='td6'>操作</td></tr>";

         AjaxStart("../ajax/fcsetting.ashx?getlist", param, function (data) {
             if (data.code != 0) {
                 $("#list").html(html + "<tr><td colspan='8'>" + data.msg + "</td></tr>");
             }
             else {
                 $("#list").html("");
                 var list = data.item.table;
                 for (var i = 0; i < list.length; i++) {
                     var area = "";
                     if (list[i].area1 != null)
                         area += list[i].area1;

                     if (list[i].area1 != null)
                         area += "-" + list[i].area2;

                     if (list[i].area1 != null)
                         area += "-" + list[i].area3;
                     var state = "未审核";
                     if (list[i].state == 1)
                         state = "已审核";
                     else if (list[i].state == 2)
                         state = "<span style='color:red'>已拒绝</span>";

                     html += "<tr>";
                     html += "<td>" + list[i].user_id + "</td>";
                     html += "<td>" + list[i].truename + "</td>";
                     html += "<td>" + (list[i].wx_number == null ? "" : list[i].wx_number) + "</td>";
                     html += "<td>" + (list[i].wx_picurl == null ? "" : "<a href='" + list[i].wx_picurl + "' target=\"_blank\"><img src='" + list[i].wx_picurl + "' style='height:50px;'/></a>") + "<br>"
                     + (list[i].wx_name == null ? "" : list[i].wx_name) + "</td>";
                     html += "<td>" + (list[i].mobile == null ? "" : list[i].mobile) + "</td>";
                     html += "<td>" + area + "</td>";
                     html += "<td id='state" + list[i].id + "'>" + state + "</td>";
                     html += "<td><a href='javascript:' onclick=\"check(1,'" + list[i].id + "')\">通过</a> | <a href='javascript:' onclick=\"check(2,'" + list[i].id + "')\">拒绝</a></td>";
                     html += "</tr>";
                 }
                 $("#list").html(html);
             }
             pager.initPage(page, data.item.itemCount, 20, 5, GetList);
         });
     }

     function check(state, ids) {

         AjaxStart("../ajax/fcsetting.ashx?check", "state=" + state + "&ids=" + ids, function (data) {
             if (data.code != 0)
                 Alert(data.msg);
             else {
                 Alert("操作成功");
                 var s = "未审核";
                 if (state == 1)
                     s = "已审核";
                 else
                     s = "已拒绝";
                 var arr = ids.split(",");
                 for (var i = 0; i < arr.length; i++) {
                     $("#state" + arr[i]).html(s);
                 }
             }
         });
     }

     function submits() {
         islogin();
         GetList(1);
     }
 </script>
</body>
</html>
